package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;

public class BankService {

	protected void addClient(String name, String fioClient,
			Client.Gender gender, Client.Accoun accoun) {

		if ((Bank.name != null) && (Bank.name.equals(name))) {
			if (accoun == Client.Accoun.CheckingAccount) {
				Client client = new Client(fioClient, gender, Client.Accoun.CheckingAccount);
				if (client != null) {
					
					Bank.clients[Bank.numerClient] = client;
                    
					Bank.numerClient++;
				}
			}
			if (accoun == Client.Accoun.SavingsAccount) {
				Client client = new Client(fioClient, gender,
						Client.Accoun.SavingsAccount);
				if (client != null) {
					Bank.clients[Bank.numerClient] = client;

					Bank.numerClient++;
				}

			}
		}

	}

}
